home *** CD-ROM | disk | FTP | other *** search
- PROCEDURE RegPayLoan;
- VAR
- NumPays, NumYears, ExtraPays: integer;
- principal, percent, rate: real;
-
- BEGIN { Main}
- writeln('Regular Payment on a Loan');
- REPEAT
- writeln;
- write('Principal: $');
- readln(principal);
- REPEAT
- write('Number of payments per year? ')
- UNTIL ReadInt(NumPays, 1, maxint);
- REPEAT
- write('Whole number of years: ');
- UNTIL ReadInt(NumYears, 0, maxint);
- REPEAT
- write('Number of payments beyond last whole year: ')
- UNTIL ReadInt(ExtraPays, 0, maxint);
- write('Annual interest rate: (%) ');
- readln(percent);
- rate := (percent / Numpays) / 100;
- writeln('Regular payment = $', principal * rate
- / (1 - IntRaise(rate + 1, -NumPays
- * NumYears - ExtraPays)):6:2);
- writeln
- UNTIL NotAgain
- END;